// pages/my/myInfo_admin_info_verify/myInfo_admin_info_verify.js
const app = getApp();
const API = require('../../../API/api.js');
Page({

    /**
     * 页面的初始数据
     */
    data: {
        pageId: null,
        Length: 6, //输入框个数
        isFocus: true, //聚焦
        Value: "", //输入的内容
        ispassword: true, //是否密文显示 true为密文， false为明文。
        tel: 13060110993,
        name: '王百万',
        money: 100,
        isShow: true
    },
    Focus(e) {
        var that = this;
        console.log(e.detail.value);
        var inputValue = e.detail.value;
        that.setData({
            Value: inputValue,
        })
    },
    Tap() {
        var that = this;
        that.setData({
            isFocus: true,
        })
    },
    formSubmit(e) {
        console.log(e.detail.value.password);
        let id = this.data.pageId;
        if (id == 1) {
            wx.getStorage({
                key: 'realNameInfo',
                success(res) {
                    console.log(res.data)
                    API.addRealNameInfo({
                        userId: wx.getStorageSync('userId'),
                        name: res.data.name,
                        idCard: res.data.idcard,
                        verificationCode: e.detail.value.password
                    }).then((res) => {
                        console.log(res)
                    })
                }
            })

            wx.navigateTo({
                url: '../../my/myInfo_admin_info_verify_pass/myInfo_admin_info_verify_pass',
            })
        } else if (id == 3) {
            wx.navigateTo({
                url: '../../my/myInfo_wallet_passDeposit/myInfo_wallet_passDeposit',
            })
        } else if (id == 4) {
            wx.redirectTo({
                url: '../../my/myInfo_wallet_depositAccount/myInfo_wallet_depositAccount',
            })
        } else {
            wx.navigateTo({
                url: '../../my/myInfo_admin_change_mobile_verify/myInfo_admin_change_mobile_verify',
            })
        }

    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        console.log(options.id)
        this.setData({
            pageId: options.id
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})
